﻿using Grpc.Net.Client;
using Stee.FGMS.CAD.IncidentSrv.GrpcService;
using System;
using System.Threading.Tasks;


namespace ConsoleApp1
{
    class Program
    {
        static  void  Main(string[] args)
        {
            Test().Wait();
            Console.ReadKey();
        }

        static async Task Test()
        {

            Console.WriteLine("Hello World!");

            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            using var channel = GrpcChannel.ForAddress("http://localhost:5001");
            var client = new Greeter.GreeterClient(channel);
            var code = DateTime.Now.ToString("ddHHmmss");

            var r = await client.CreateCodeAsync(new EventCodeReq { Code = DateTime.Now.ToString("ddHHmmss"), Description = "描述"+DateTime.Now });
            // var model = await client.GetCodeAsync(new EventCodeReq { Code = r.Code });
        }

    }
}
